<?php

require 'header.php';
require 'DAO.php';
require 'authorisation.php';

$con = new connection();

$result = $con->fetchNews();

header('Content-type: text/xml');
echo '<NEWS>';
foreach($result as &$row) {
    echo '<ANNOUNCEMENT>
        <MESSAGE>'.$row[0].'</MESSAGE>
        <TITLE>'.$row[1].'</TITLE>
        <DT>'.$row[2].'</DT>
        <POSTER>'.$row[3].'</POSTER>
        </ANNOUNCEMENT>';
}
echo '</NEWS>';

?>
